package com.zxy.ziems.server.controller;

import com.zxy.btp.common.response.JsonResponse;
import com.zxy.ziems.server.dto.ClassifyPointRelDeleteDto;
import com.zxy.ziems.server.dto.ClassifyPointRelDto;
import com.zxy.ziems.server.service.ClassifyPointRelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName ClassifyPointRelController
 * @Description
 * @Author 邓伟
 * @Date 2023/11/28 13:31
 * @Version 1.0
 */
@RestController
@RequestMapping("/api/pointRel")
public class ClassifyPointRelController {

    @Autowired
    private ClassifyPointRelService classifyPointRelService;

    @PostMapping("/bindPoint")
    public JsonResponse bindPoint (@RequestBody @Validated ClassifyPointRelDto classifyPointRelDto) {
        classifyPointRelService.bindPoint(classifyPointRelDto);
        return JsonResponse.SUCCESS();
    }

    @PostMapping("/delete")
    public JsonResponse delete (@RequestBody @Validated ClassifyPointRelDeleteDto relDto) {
        classifyPointRelService.delete(relDto);
        return JsonResponse.SUCCESS();
    }

}
